home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK2.toast / Development Kits (Disc 2) / ScriptX / Draggable ScriptX Folders / utils / DTK / source / DIRIMP_SX / compdimp.sx < prev    next >
Encoding:
Text File  |  1995-12-13  |  1.9 KB  |  86 lines  |  [TEXT/ttxt]

  1. --<<<
  2.  
  3. -- Force loading of the modules, so we can use them
  4. -- in the DirectorImporter module
  5.  
  6.  
  7. if (getModule @DTK) = false do
  8.     open TitleContainer path:"utils/dtk/dtk.sxt"    
  9. if (getModule @ScorePlayer) = false do
  10.     open LibraryContainer path:"utils/dtk/dirimp/scorplay.sxl"
  11.     
  12.  
  13.  
  14. module DirectorImporter
  15.     uses ScriptX
  16.     uses DTK
  17.     uses ScorePlayer
  18.     
  19.     exports importDirector
  20.     
  21.     exports ScorePlayerScoreTranslator
  22.     exports ScorePlayerCastTranslator
  23.     exports registerDirectorImporter
  24. end
  25. module DirImpAssemble
  26.     uses scriptX, DirectorImporter
  27. end
  28. in module DirectorImporter
  29.  
  30. (
  31.     local sourceDir := spawn theStartDir "utils/dtk/source/dirimp_sx"
  32.     local directorImporterModule := getModule @DirectorImporter
  33.                     
  34.     -- Now, fileIn the DirectorImporter code
  35.     fileIn sourceDir name:"castdir.sx" module:directorImporterModule
  36.     fileIn sourceDir name:"scor2scp.sx" module:directorImporterModule
  37.     fileIn sourceDir name:"dirimp.sx" module:directorImporterModule
  38.  
  39.     -- Let the current system know about us
  40.     registerDirectorImporter()
  41.     
  42.     function ImportDirector #key container:(unsupplied) -> (
  43.         local op := new OpenPanel
  44.         append op.typeList "VWMD"
  45.         openFilePanel op
  46.         if op.validReply = false do return
  47.         local theFileName := op.fileName
  48.         
  49.         return importMedia theImportExportEngine theFileName @Metaphor @Director @ScorePlayer \
  50.             container:container
  51.         
  52.     )
  53.     
  54. )
  55.  
  56. in module DirImpAssemble
  57.  
  58. (
  59.     local directorImporterModule := getModule @DirectorImporter
  60.     local tc := new LibraryContainer path:"utils/dtk/dirimp/dirimp.sxl" name:"DirectorImporter"
  61.     append tc directorImporterModule
  62.     tc.startupAction := (self -> \
  63.         (
  64.             foreach self load undefined
  65.             (value (findmoduleBinding (getModule @DirectorImporter) @registerDirectorImporter))()
  66.         )
  67.     )
  68.     
  69.     (
  70.         local dtktc
  71.         local scorplaytc
  72.  
  73.         dtktc := open TitleContainer path:"utils/dtk/dtk.sxt"
  74.  
  75.         scorplaytc := open LibraryContainer path:"utils/dtk/dirimp/scorplay.sxl"
  76.  
  77.         addUser dtktc tc
  78.         addUser scorplaytc tc
  79.     )
  80.     
  81.     close tc
  82.  
  83. )
  84.  
  85.  
  86.